$OpenBSD: patch-complete_c,v 1.1 2015/01/10 13:13:16 sthen Exp $
--- complete.c.orig	Sat Jan 10 13:07:16 2015
+++ complete.c	Sat Jan 10 13:08:38 2015
@@ -264,9 +264,8 @@ complete_ifname(char *word, int list, EditLine *el)
                         sl_add(words, ifnp->if_name);
         }
 
-	if_freenameindex(ifn_list);
-
         rv = complete_ambiguous(word, list, words, el);
+	if_freenameindex(ifn_list);
         sl_free(words, 0);
         return (rv);
 }
